<?php

/**
 * This is the model class for table "luasdaerahjmlkepadatanpenduduk".
 *
 * The followings are the available columns in table 'luasdaerahjmlkepadatanpenduduk':
 * @property integer $ldjk_id
 * @property integer $ldjk_kecamatan
 * @property double $ldjk_luasdaerah
 * @property integer $ldjk_jmlpenduduk
 * @property integer $ldjk_kepadatanpenduduk
 *
 * The followings are the available model relations:
 * @property Kecamatan $ldjkKecamatan
 */
class Luasdaerahjmlkepadatanpenduduk extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Luasdaerahjmlkepadatanpenduduk the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'luasdaerahjmlkepadatanpenduduk';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('ldjk_kecamatan, ldjk_jmlpenduduk, ldjk_kepadatanpenduduk', 'numerical', 'integerOnly'=>true),
			array('ldjk_luasdaerah', 'numerical'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('ldjk_id, ldjk_kecamatan, ldjk_luasdaerah, ldjk_jmlpenduduk, ldjk_kepadatanpenduduk', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'ldjkKecamatan' => array(self::BELONGS_TO, 'Kecamatan', 'ldjk_kecamatan'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'ldjk_id' => 'Ldjk',
			'ldjk_kecamatan' => 'Ldjk Kecamatan',
			'ldjk_luasdaerah' => 'Ldjk Luasdaerah',
			'ldjk_jmlpenduduk' => 'Ldjk Jmlpenduduk',
			'ldjk_kepadatanpenduduk' => 'Ldjk Kepadatanpenduduk',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('ldjk_id',$this->ldjk_id);
		$criteria->compare('ldjk_kecamatan',$this->ldjk_kecamatan);
		$criteria->compare('ldjk_luasdaerah',$this->ldjk_luasdaerah);
		$criteria->compare('ldjk_jmlpenduduk',$this->ldjk_jmlpenduduk);
		$criteria->compare('ldjk_kepadatanpenduduk',$this->ldjk_kepadatanpenduduk);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}